package com.lingyun.mqttserver.controller.dashborard;

import com.lingyun.mqttserver.service.ManageDataService;
import com.lingyun.mqttserver.vo.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

// 数据看板接口
@RestController
@RequestMapping("dashboard")
public class DashboardController {

    @Autowired
    private ManageDataService manageDataService;

    /**
     *  获取看板统计数据
     */
    @GetMapping("dashboardStats")
    public Result dashboardStats(){
        return manageDataService.dashboardStats();
    }

    /**
     * 获取项目设备分布
     */
    @GetMapping("projectDistribution")
    public Result projectDistribution(){
        return manageDataService.projectDistribution();
    }

    /**
     * 获取最近更新
     */
    @GetMapping("recentData")
    public Result recentData(){
        return manageDataService.recentData();
    }



}
